<extend name="Public:admin"/>
<block name="extra-js">
<script src="__JS__/common/setCover.js"></script>
<script src="__JS__/common/postEdit.js"></script>
<script type="text/javascript">
$(function(){
	$(".editbtn").bind("click",function(){
		var $key = $(this).attr("data");
		$.ajax({
			url:"__URL__/edit",
			data: { key: $key },
			type:"post",
			dataType:"text",
			success: function(data){
				$data = $.parseJSON(data);
				$("#edit_hotel_name").val($data["hotel_name"]);
				$("#edit_hotel_addr").val($data["hotel_addr"]);
				$("#edit_hotel_tel").val($data["hotel_tel"]);
				$("#edit_hotel_more").val($data["hotel_more"]);
				$("#edit_hotel_detail").val($data["hotel_detail"]);
				$("#hotel_edit_form").attr("action","__URL__/update?place="+$key);
				$("#hotelEditModal").modal("show");
			}
		});
	});
});
</script>
</block>
		<block name="main-content">	
	
	<!-- start 住宿信息 -->
		<div class="row">
			<h1>住宿信息</h1>
		  </div>
		<div class="row">
        	<form class="form-horizontal" role="form" method="post" id="hotel_form">
        	<volist name="hotel_arr" id="vo">
				<h2>{$vo.hotel_name}</h2>
				<div class="btn-group" role="group">
					<a href="javascript:void(0)" class="btn btn-default editbtn" data="{$key}">编辑</a>&nbsp;
					<a class="btn btn-default" href="__URL__/delete?place={$place}&key={$key}">删除</a>
				</div><br><br>
				
				<div class="panel panel-default">
				  <div class="panel-heading">
				    <h3 class="panel-title">酒店封面</h3>
				  </div>
				  <div class="panel-body">
				    <div class="col-sm-8"><p id="hotel_cover{$key}">{$vo.hotel_cover}</p>
					<a class="btn btn-default" data-toggle="modal" data-target="#coverModal" href="#" onclick="setCover.setId({$key})">选择封面</a></div>
				  </div>
				</div>
					<div class="panel panel-default">
					  <div class="panel-heading">
					    <h3 class="panel-title">酒店名字</h3>
					  </div>
					  <div class="panel-body">
					    {$vo.hotel_name}
					  </div>
					</div>
					<div class="panel panel-default">
					  <div class="panel-heading">
					    <h3 class="panel-title">地址</h3>
					  </div>
					  <div class="panel-body">
					    {$vo.hotel_addr}
					  </div>
					</div>
					<div class="panel panel-default">
					  <div class="panel-heading">
					    <h3 class="panel-title">电话</h3>
					  </div>
					  <div class="panel-body">
					    {$vo.hotel_tel}
					  </div>
					</div>
					<div class="panel panel-default">
					  <div class="panel-heading">
					    <h3 class="panel-title">具体信息</h3>
					  </div>
					  <div class="panel-body">
					    {$vo.hotel_detail}
					  </div>
					</div>
					<div class="panel panel-default">
					  <div class="panel-heading">
					    <h3 class="panel-title">更多信息</h3>
					  </div>
					  <div class="panel-body">
					    {$vo.hotel_more}
					  </div>
					</div>
			</volist>
			</form>
		</div>
	<!-- end 住宿信息 -->
	<!-- start modal -->
	<include file="Public/hotelSetcover" />
	<!-- end modal -->

	<div class="row">
		<button class="btn btn-success" data-toggle="modal" data-target="#hotelModal" href="#">添加信息</button>
	</div>
	<!-- start modal -->
<include file="Public/hotelCreatemodal" />
	<!-- 编辑 -->
<include file="Public/hotelEditmodal" />
	<!-- end modal -->

</block>

